<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="请输入1~100之间的整数">
<input type="button" value="Guess" onclick="f()">
<div> </div>

<script>
    let l =parseInt(Math.random()*100+1);
    let i =document.querySelector("input");
    let d =document.querySelector("div");
    let count =0;
    function f() {
        count++;
        if (i.value>l){
            d.innerText="太大了";
        }else if (i.value<l){
            d.innerText="太小了";

        }else {
            d.innerText="Times is "+count+" Guess True";
            l = parseInt(Math.random()*100+1);
            count=0;
        }
        i.value="";
        console.log(l)
    }


</script>
</body>
</html>